package StructuralPattern.ProxyPattern;

import StructuralPattern.ProxyPattern.DynamicProxy.DynamicProxyHandler;
import StructuralPattern.ProxyPattern.DynamicProxy.RealService;
import StructuralPattern.ProxyPattern.DynamicProxy.Service;
//import StructuralModel.ProxyPattern.StaticProxy.ProxyService;

public class TestProxyPattern {
    public static void main(String[] args) {
        //静态代理
//        Service proxyService=new ProxyService();
//        proxyService.add();
//        System.out.println();
//        proxyService.del();

        //动态代理
        Service service = new RealService();
        Service serviceProxy = (Service) new DynamicProxyHandler(service).getRealService();
        serviceProxy.add();
        System.out.println();
        serviceProxy.del();

        //https://blog.csdn.net/m0_51380306/article/details/119912574
    }
}
